home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
FLAT.ZIP
/
MEMMAN.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-29
|
3KB
|
89 lines
/****************************************************************************
** Program: Memory Manager
** File: memman.h
** Model: medium
** Windows: 3.0
** Version: 1.0
** Autor: hb
** Stand: 5.6.92
****************************************************************************/
/* ERROR-Codes */
#define IDE_OK 0
#define IDE_REALMODE -1
#define IDE_ONLYONEHEAP -2
#define IDE_NOMEMAVAIL -3
#define IDE_MEMERROR -4
#define IDE_NOHEAP -5
#define IDE_NULLPOINTER -6
#define IDE_NOMELT -7
#define IDE_NOTINHEAP -8
/* numeric defines */
#define SEGMENT 65536L
#define MAXLIST 1000
/* typedefs */
typedef struct node
{
long lSize;
long lOffset;
} NODE, FAR *LPNODE;
/* Prototypen */
int CreateHeap (long, int);
int DestroyHeap (void);
void far *AllocMemMan (long);
void far *ReAllocMem (void far *, long);
int FreeMem (void far *);
long GetOffset (void far *);
void far *GetPointer (long);
int GetHeapIndex (long);
int GetFreeIndex (long);
int GetFreeHeapIndex (void);
int GetFreeFreeIndex (void);
int MeltFreeList (void);
void SortFreeNodes (LPNODE, int, int);
void ShowMemoryError (int error);
/* helper routine in memutil.c */
void SortFree (void);
void WalkHeap (HWND, int, int, int);
void lmemfill (LPSTR, char, long);
void Shake (HWND, int, long);
void DrawHeap (HWND, HDC);
void ShowHeapList (HWND, int);
void ViewHeap (HWND, int, long);
/* global variables */
#if defined( MAINMEM )
HANDLE hHeap, /* Handle of glbal heap */
hHeapNodes, /* Handle of heapnodes */
hFreeNodes; /* Handle of freenodes */
char huge *hpBase; /* Basepointer of heap */
int nFreeUsed; /* used nodes in freenodes */
int nHeapUsed; /* used node in heapnodes */
int nNodes; /* max nuber of handles in free- and heapnodes */
long lSegBorder; /* Offset for segment boundaries */
long lHeapSize; /* size of heap */
LPNODE FreeNodes; /* list of free nodes */
LPNODE HeapNodes; /* list of heap nodes */
#else
extern HANDLE hHeap,
hHeapNodes,
hFreeNodes;
extern char huge *hpBase;
extern int nFreeUsed;
extern int nHeapUsed;
extern int nNodes;
extern long lSegBorder;
extern long lHeapSize;
extern LPNODE FreeNodes;
extern LPNODE HeapNodes;
#endif